@extends('app')

@section('content')

<link href="{{ asset('/css/spinners.css') }}" rel="stylesheet">

<div id="grid" class="grid" style="position: fixed;z-index: 1000;left:50%;display: none;">
    <div class="cell">
        <div class="card">
            <span class="throbber-loader">Loading…</span>
        </div>
    </div>
</div>
<ul class="nav nav-tabs">
    <li class="active"><a href="{{ url('/admin/content/position')}}">信息列表</a></li>
    <li><a href="{{ url('/admin/content/position/create') }}">信息添加</a></li>
</ul>

<!--<div id="grid" class="grid" style="position: absolute;top:0px;left:45%;display: none;z-index: 1000;width: 100%;height: 100%;">-->

<h5 class="sub-header"></h5>
<div class="table-responsive">
    <table class="table table-striped">
        <thead>
        <tr>
            <th>编号</th>
            <th>名称</th>
            <th>别名</th>
            <th>启用</th>
            <th>排序</th>
            <th>发布时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        @foreach($adsposition as $res)
        <tr id="news_{{ $res->id }}">
            <td>{{ $res->id }}</td>
            <td><a href="{{ url('admin/content/position/'.$res->id.'/edit') }}">{{ $res->title }} </a></td>
            <td>{{ $res->alias }}</td>
            <td id="disabled">
                @if($res->is_disabled == 0)
                <span class="glyphicon glyphicon-ok-circle  green-remove"
                    onclick="changeStatus('/admin/content/position/disabled','{{ $res->id }}', '{{ $res->is_disabled }}', '{{ csrf_token() }}')"></span>
                @else
                <span class="glyphicon glyphicon-remove-circle red-ok"
                      onclick="changeStatus('/admin/content/position/disabled','{{ $res->id }}', '{{ $res->is_disabled }}', '{{ csrf_token() }}')"></span>
                @endif
            </td>
            <td>{{ $res->sort}}</td>
            <td>{{ $res->updated_at }}</td>
            <td>
                <a href="{{ url('/admin/content/position/'.$res->id.'/edit') }}"><i class="glyphicon glyphicon-edit"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;
                <a href="javascript:void(0);" onclick="delete_one('/admin/content/position/{{$res->id}}','{{$res->id}}','{{ csrf_token() }}')"><i class="glyphicon glyphicon-remove-sign"></i></a>
            </td>
        </tr>
        @endforeach
        </tbody>
    </table>
</div>
<div>{!! $adsposition->render() !!} </div>

<script src="{{ asset('/js/jquery.pin.js') }}" type="text/javascript"></script>
<script type="text/javascript">
//        $(".grid").pin();


</script>
@endsection
